package cn.com.petrochina.lpm3.vo.mdm;

import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
public class RequestBody {
    @JsonProperty("TechInfo")
    private TechInfo techInfo;

    @JsonProperty("DATA")
    private QueryDATA data;

//    @JsonProperty("DATA")
//    private Map<String,Object> dataMap;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class TechInfo {
        public TechInfo(String transID, String transTime, String count) {
            this.transID = transID;
            this.transTime = transTime;
            if (StringUtils.isNotEmpty(count)) {
                this.count = count;
            }
        }

        @JsonProperty("TransID")
        private String transID;

        @JsonProperty("TransTime")
        private String transTime;

        @JsonProperty("Caller")
        private String caller = "A2";

        @JsonProperty("SysID")
        private String sysID = "MDM";

        @JsonProperty("Count")
        private String count = "500";

        @JsonProperty("BizKeyItems")
        private BizKeyItem bizKeyItems = new BizKeyItem("A");
    }

    @Data
    @AllArgsConstructor
    public static class BizKeyItem {
        @JsonProperty("BizKey")
        private String bizKey;
    }

    @Data
    @AllArgsConstructor
    public static class QueryDATA {
        @JsonProperty("Query")
        private Query query;
    }
}
